﻿<UserControl x:Class="WiFiChannelSpread.AccessPointControl" x:Name="MyRoot"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             xmlns:my="clr-namespace:WiFiChannelSpread"
             mc:Ignorable="d" d:DesignHeight="100" d:DesignWidth="300"
             VerticalAlignment="Bottom" Height="{Binding ElementName=MyRoot, Path=HeightFromSignalStrength}"
             Cursor="Hand"
             MouseEnter="MyRoot_MouseEnter" MouseLeave="MyRoot_MouseLeave" MouseDown="MyRoot_MouseDown">
    <my:Planerator x:Name="Planerator1" RotationX="0">
    <Grid>
        <Border Name="BackgroundSquare" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" CornerRadius="5"
                Padding="1"
                BorderThickness="1,4,1,4" BorderBrush="{Binding ElementName=MyRoot, Path=HighlightColor}"
                Opacity="{Binding ElementName=MyRoot, Path=OpacityFromSignalStrength}">
            <Border.Background>
                <LinearGradientBrush>
                    <LinearGradientBrush.GradientStops>
                        <GradientStop Offset="0" Color="White"/>
                        <GradientStop Offset="1" Color="#EEEEEE"/>
                    </LinearGradientBrush.GradientStops>
                </LinearGradientBrush>
            </Border.Background>
        </Border>
        <StackPanel>
            <Grid Name="TitleBar" Margin="2,5,2,0">
                <Border Name="LabelName" Padding="2" Background="White" CornerRadius="5" HorizontalAlignment="Left"
                        Opacity="{Binding ElementName=MyRoot, Path=OpacityFromSignalStrength}">
                    <Label Padding="0" FontWeight="Bold" Content="{Binding ElementName=MyRoot,Path=AccessPointTitle}" FontSize="11" />
                </Border>
                <StackPanel Orientation="Horizontal" HorizontalAlignment="Right" VerticalAlignment="Top">
                        <Image Name="GlobeUnknownImage" ToolTip="Geolocation not available" Width="16" Height="16" Margin="2" Visibility="Collapsed" Source="Images/Globe_Unknown.png" Opacity="0.6" />
                        <Image Name="GlobeImage" ToolTip="Geolocation available" Width="16" Height="16" Margin="2" Visibility="Collapsed" Source="Images/Globe.png" Opacity="0.8" />
                        <Image Name="LockImage" ToolTip="Secured" Width="16" Height="16" Margin="2" Visibility="Collapsed" Source="Images/Lock.png" />
                        <Image Name="UnlockImage" ToolTip="Unsecured" Width="16" Height="16" Margin="2" Visibility="Collapsed" Source="Images/Unlock.gif" />
                </StackPanel>
            </Grid>
            <StackPanel Orientation="Horizontal" Margin="5,0,5,0">
                <Label Name="LinkQualityLabel" Padding="0" Content="{Binding ElementName=MyRoot,Path=LinkQualityText}" FontSize="10">
                    <Label.Margin>
                        <Thickness Right="5" />
                    </Label.Margin>
                </Label>
                <Label Name="AuthenticationLabel" Padding="0" Content="{Binding ElementName=MyRoot,Path=MyNetwork.DefaultAuthenticationAlgorithmString}" FontSize="10">
                    <Label.Margin>
                        <Thickness Right="5" />
                    </Label.Margin>
                </Label>
                <Label Name="EncryptionLabel"     Padding="0" Content="{Binding ElementName=MyRoot,Path=MyNetwork.DefaultCipherAlgorithmString}" FontSize="10">
                    <Label.Margin>
                        <Thickness Right="5" />
                    </Label.Margin>
                </Label>
                <Label Name="PhyTypeLabel" Padding="0" Content="{Binding ElementName=MyRoot,Path=PhyTypeText}" FontSize="10">
                </Label>
            </StackPanel>
        </StackPanel>
    </Grid>
    </my:Planerator>
</UserControl>
